package com.ndky.week3.package2;

/**
 * author: 核桃
 * 类的构造方法
 * date: 2023/9/28
 **/
public class MyClass3 {
    int x;

    public MyClass3(int y) {
        System.out.println("构造MyClass3");
        x = y;
    }

    public static void main(String[] args) {
        MyClass3 myObj = new MyClass3(5);
        System.out.println(myObj.x);

    }
}

//输出 构造MyClass3
//输出 5